//
// Created by draw on 19-5-29.
//

#ifndef _SERIAL_H
#define _SERIAL_H

#include "Msp.h"


class Serial
{
public:
    Usart *UART;
    Gpio *TxPort;
    Gpio *RxPort;
    u32 TxPin;
    u32 RxPin;

    Dma *RxDma;
    DmaStream *RxDs;
    Dma_Channel RxDc;

public:
    Serial(
            Usart *uart,
            Gpio *txPort,
            Gpio *rxPort,
            u32 txPin,
            u32 rxPin,
            Dma *rxDma,
            DmaStream *rxDs,
            Dma_Channel rxDc
          );

    void SetUpRxDma(u8 *buf, u32 len);

};


#endif //ARMCPP_SERIAL_H
